<%@ page import="rentadomus.Place" %>



<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'date', 'error')} ">
	<label for="date">
		<g:message code="place.date.label" default="Date" />
		
	</label>
	<g:datePicker name="date" precision="day"  value="${placeInstance?.date}" default="none" noSelection="['': '']" />
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'titlePlace', 'error')} required">
	<label for="titlePlace">
		<g:message code="place.titlePlace.label" default="Title Place" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="titlePlace" required="" value="${placeInstance?.titlePlace}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'mainImage', 'error')} required">
	<label for="mainImage">
		<g:message code="place.mainImage.label" default="Main Image" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="mainImage" type="number" value="${placeInstance.mainImage}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'strata', 'error')} required">
	<label for="strata">
		<g:message code="place.strata.label" default="Strata" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="strata" from="${placeInstance.constraints.strata.inList}" required="" value="${fieldValue(bean: placeInstance, field: 'strata')}" valueMessagePrefix="place.strata"/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'address', 'error')} required">
	<label for="address">
		<g:message code="place.address.label" default="Address" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="address" required="" value="${placeInstance?.address}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'rentPrice', 'error')} required">
	<label for="rentPrice">
		<g:message code="place.rentPrice.label" default="Rent Price" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="rentPrice" value="${fieldValue(bean: placeInstance, field: 'rentPrice')}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'area', 'error')} required">
	<label for="area">
		<g:message code="place.area.label" default="Area" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="area" value="${fieldValue(bean: placeInstance, field: 'area')}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'neighborhood', 'error')} required">
	<label for="neighborhood">
		<g:message code="place.neighborhood.label" default="Neighborhood" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="neighborhood" required="" value="${placeInstance?.neighborhood}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'description', 'error')} required">
	<label for="description">
		<g:message code="place.description.label" default="Description" />
		<span class="required-indicator">*</span>
	</label>
	<g:textArea name="description" value="${placeInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'cableTv', 'error')} ">
	<label for="cableTv">
		<g:message code="place.cableTv.label" default="Cable Tv" />
		
	</label>
	<g:checkBox name="cableTv" value="${placeInstance?.cableTv}" />
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'energy', 'error')} ">
	<label for="energy">
		<g:message code="place.energy.label" default="Energy" />
		
	</label>
	<g:checkBox name="energy" value="${placeInstance?.energy}" />
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'gas', 'error')} ">
	<label for="gas">
		<g:message code="place.gas.label" default="Gas" />
		
	</label>
	<g:checkBox name="gas" value="${placeInstance?.gas}" />
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'idPerson', 'error')} required">
	<label for="idPerson">
		<g:message code="place.idPerson.label" default="Id Person" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="idPerson" name="idPerson.id" from="${rentadomus.Person.list()}" optionKey="id" required="" value="${placeInstance?.idPerson?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'img', 'error')} ">
	<label for="img">
		<g:message code="place.img.label" default="Img" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${placeInstance?.img?}" var="i">
    <li><g:link controller="images" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="images" action="create" params="['place.id': placeInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'images.label', default: 'Images')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'phone', 'error')} ">
	<label for="phone">
		<g:message code="place.phone.label" default="Phone" />
		
	</label>
	<g:checkBox name="phone" value="${placeInstance?.phone}" />
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'water', 'error')} ">
	<label for="water">
		<g:message code="place.water.label" default="Water" />
		
	</label>
	<g:checkBox name="water" value="${placeInstance?.water}" />
</div>

<div class="fieldcontain ${hasErrors(bean: placeInstance, field: 'wifi', 'error')} ">
	<label for="wifi">
		<g:message code="place.wifi.label" default="Wifi" />
		
	</label>
	<g:checkBox name="wifi" value="${placeInstance?.wifi}" />
</div>